<script lang='ts' setup>
import EChart from '_c/EChart/index.vue'
import ChartConfig from './chartConfig/index.vue'
import { onMounted, ref } from 'vue'
import { getAreaCount } from '@/api/map'
const nameArr: Array<string> = []
const dataArr: Array<number> = []
const configShow = ref<boolean>(false)
onMounted(async () => {
  let res = await getAreaCount()
  res.forEach(item => {
    nameArr.push(item.name)
    dataArr.push(item.count)
  })
  configShow.value = true
  console.log(res)
})
</script>
<template>
  <EChart>
    <ChartConfig v-if="configShow" :name="nameArr" :data="dataArr"></ChartConfig>
  </EChart>
</template>
<style lang='scss' scoped>
</style>